package com.Day1008;
//  如果想实现引用类型的比较,要实现一个接口 implements Comparable<Student>
public class Student {
    private String name;
    private Gender sex;
    private int age;

    public Student(String name, Gender sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    public Student() {
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Gender getSex() {
        return sex;
    }

    public void setSex(Gender sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Student{" + "name='" + name + '\'' + ", sex=" + sex + ", age=" + age + '}';
    }

    //    接口的回调
    public void test(MyText myText){
        System.out.println("学生的test开始");
        myText.test1();
        System.out.println("学生的test结束");
    }

//    @Override
//    public int compareTo(Student o) {
//        //  -1正序(小于)  0相等  1倒序(大于)
//        if (this.age < o.age){
//            return 1;
//        }
//        return 0;
//    }
}
